package 练习05_用线程池改造异步查询订单和收货地址;

/**
 * @ClassName: TestThreadSearch
 * @Author: AllenSun
 * @Date: 2022/3/21 下午10:57
 */
public class TestThreadSearch {

    public static void getOrder() {
        try {
            Thread.sleep(1000);
            System.out.println("获取订单信息");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public static void getAddress() {
        try {
            Thread.sleep(1000);
            System.out.println("获取地址信息");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        long start = System.currentTimeMillis();
        getOrder();
        getAddress();
        long end = System.currentTimeMillis();
        //花费时间：2007
        System.out.println("花费时间："+(end-start));

    }
}
